import {legacy_createStore as createStore,applyMiddleware,combineReducers} from 'redux'
import shopcartReducer from '@/store/reducer/shopcartReducer'
import counterReducer from './reducer/counterReducer'
import {composeWithDevTools} from 'redux-devtools-extension'
//从项目中引入中间件对象
import thunk from 'redux-thunk'
import logger from 'redux-logger'
//应用中间件
const ehMiddleWare=applyMiddleware(thunk,logger)
const a=composeWithDevTools(ehMiddleWare)
//调用combineReducers方法来创建一个最终reducer
const bigReducer=combineReducers({
    gouwuche:shopcartReducer,
    jishuqi:counterReducer
})
const store=createStore(bigReducer,a)
export default store